<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:59:"D:\tp5o2o\public/../application/index\view\lists\index.html";i:1519636339;s:49:"D:\tp5o2o\application\index\view\public\head.html";i:1519611431;s:48:"D:\tp5o2o\application\index\view\public\nav.html";i:1519530143;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title><?php echo $title; ?></title>
    <link rel="shortcut icon" href="">
    <link rel="stylesheet" href="/static/index/css/base.css"/>
    <link rel="stylesheet" href="/static/index/css/common.css"/>
    <link rel="stylesheet" href="/static/index/css/<?php echo $controller; ?>.css"/>
    <script type="text/javascript" src="/static/index/js/html5shiv.js"></script>
    <script type="text/javascript" src="/static/index/js/respond.min.js"></script>
    <script type="text/javascript" src="/static/index/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/static/index/js/common.js"></script>
</head>
<body>
<div class="header-bar">
    <div class="header-inner">
        <ul class="father">
            <li><a><?php echo $citys['name']; ?></a></li>
            <li>|</li>
            <li class="city">
                <a>切换城市<span class="arrow-down-logo"></span></a>
                <div class="city-drop-down">
                    <h3>热门城市</h3>
                    <ul class="son">
                        <?php if (is_array($city) || $city instanceof \think\Collection || $city instanceof \think\Paginator): $i = 0;
                            $__LIST__ = $city;
                            if (count($__LIST__) == 0) : echo "";
                            else: foreach ($__LIST__ as $key => $vo): $mod = ($i % 2);
                                ++$i; ?>
                                <li>
                                    <a href="<?php echo url('index/index', ['city' => $vo['uname']]); ?>"><?php echo str_repeat('----', $vo['level']); ?><?php echo $vo['name']; ?></a>
                                </li>
                            <?php endforeach; endif;
                        else: echo "";endif; ?>
                    </ul>
                </div>
            </li>
            <?php if (!(empty($user) || (($user instanceof \think\Collection || $user instanceof \think\Paginator) && $user->isEmpty()))): ?>
                <li>欢迎登录糯米网! <?php echo $user['username']; ?></li>
                <li><a href="<?php echo url('user/logout'); ?>">退出登录</a></li>
            <?php else: ?>
                <li><a href="<?php echo url('user/register'); ?>">注册</a></li>
                <li>|</li>
                <li><a href="<?php echo url('user/login'); ?>">登录</a></li>
            <?php endif; ?>
            <li><a href="<?php echo url('bis/login/index'); ?>">商户中心</a></li>
        </ul>
    </div>
</div>
<div class="search">
    <img src="/static/index/image/logo.png"/>
</div>

<div class="nav-bar-header">
    <div class="nav-inner">
        <ul class="nav-list">
            <li class="nav-item">
                <span class="item">全部分类</span>
                <div class="left-menu">
                    <?php if (is_array($categorys) || $categorys instanceof \think\Collection || $categorys instanceof \think\Paginator): $i = 0;
                        $__LIST__ = $categorys;
                        if (count($__LIST__) == 0) : echo "";
                        else: foreach ($__LIST__ as $key => $vo): $mod = ($i % 2);
                            ++$i; ?>
                            <div class="level-item">
                                <div class="first-level">
                                    <dl>
                                        <dt class="title"><a href="<?php echo url('lists/index', ['id' => $key]); ?>"
                                                             target="_top"><?php echo $vo['name']; ?></a></dt>
                                        <?php if (is_array($vo['son']) || $vo['son'] instanceof \think\Collection || $vo['son'] instanceof \think\Paginator): $i = 0;
                                            $__LIST__ = is_array($vo['son']) ? array_slice($vo['son'], 0, 2, true) : $vo['son']->slice(0, 2, true);
                                            if (count($__LIST__) == 0) : echo "";
                                            else: foreach ($__LIST__ as $key => $vv): $mod = ($i % 2);
                                                ++$i; ?>
                                                <dd><a href="<?php echo url('lists/index', ['id' => $vv['id']]); ?>"
                                                       target="_top" class=""><?php echo $vv['name']; ?></a>
                                                </dd>
                                            <?php endforeach; endif;
                                        else: echo "";endif; ?>
                                    </dl>
                                </div>
                                <div class="second-level">
                                    <div class="section">
                                        <div class="section-item clearfix no-top-border">
                                            <h3>其他分类</h3>
                                            <ul>
                                                <?php if (is_array($vo['son']) || $vo['son'] instanceof \think\Collection || $vo['son'] instanceof \think\Paginator): $i = 0;
                                                    $__LIST__ = is_array($vo['son']) ? array_slice($vo['son'], 3, null, true) : $vo['son']->slice(3, null, true);
                                                    if (count($__LIST__) == 0) : echo "";
                                                    else: foreach ($__LIST__ as $key => $vv): $mod = ($i % 2);
                                                        ++$i; ?>
                                                        <li><a class="hot"
                                                               href="<?php echo url('lists/index', ['id' => $vv['id']]); ?>"><?php echo $vv['name']; ?></a>
                                                        </li>
                                                    <?php endforeach; endif;
                                                else: echo "";endif; ?>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; endif;
                    else: echo "";endif; ?>
                </div>
            </li>
            <li class="nav-item"><a class="item first active">首页</a></li>
            <li class="nav-item"><a class="item">团购</a></li>
            <li class="nav-item"><a class="item">商户</a></li>
        </ul>
    </div>
</div>



<div class="page-body">
    <div class="filter-bg">
        <div class="filter-wrap">
            <div class="w-filter-ab-test">
                <div class="w-filter-top-nav clearfix" style="margin:12px">
                </div>

                <div class="filter-wrapper">
                    <div class="normal-filter ">
                        <div class="w-filter-normal-ab  filter-list-ab">
                            <h5 class="filter-label-ab">分类</h5>
                            <span class="filter-all-ab">
                                <a class="w-filter-item-ab" href="<?php echo url('lists/index'); ?>"><span
                                            class="item-content <?php if ($categorys == ''): ?>filter-active-all-ab<?php endif; ?>">全部</span></a>
                            </span>
                            <div class="j-filter-items-wrap-ab filter-items-wrap-ab">
                                <div class="j-filter-items-ab filter-items-ab filter-content-ab">
                                    <?php if (is_array($cateFir) || $cateFir instanceof \think\Collection || $cateFir instanceof \think\Paginator): $i = 0;
                                        $__LIST__ = $cateFir;
                                        if (count($__LIST__) == 0) : echo "";
                                        else: foreach ($__LIST__ as $key => $vo): $mod = ($i % 2);
                                            ++$i; ?>
                                            <a class="w-filter-item-ab"
                                               href="<?php echo url('lists/index', ['id' => $vo->id]); ?>"><span
                                                        class="item-content <?php if ($categorys == $vo->id): ?>filter-active-all-ab<?php endif; ?>"><?php echo $vo->name; ?></span></a>
                                        <?php endforeach; endif;
                                    else: echo "";endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="filter-wrapper">
                    <div class="normal-filter ">
                        <div class="w-filter-normal-ab  filter-list-ab">
                            <h5 class="filter-label-ab">子分类</h5>
                            <span class="filter-all-ab">
                                    
                                </span>
                            <div class="j-filter-items-wrap-ab filter-items-wrap-ab">
                                <div id="se_category_id" class="j-filter-items-ab filter-items-ab filter-content-ab">
                                    <?php if (is_array($secategory) || $secategory instanceof \think\Collection || $secategory instanceof \think\Paginator): $i = 0;
                                        $__LIST__ = $secategory;
                                        if (count($__LIST__) == 0) : echo "";
                                        else: foreach ($__LIST__ as $key => $vo): $mod = ($i % 2);
                                            ++$i; ?>
                                            <a class="w-filter-item-ab"
                                               href="<?php echo url('lists/index', ['id' => $vo->id]); ?>"><span
                                                        class="item-content <?php if (\think\Request::instance()->get('id') == $vo->id): ?>filter-active-all-ab<?php endif; ?>"><?php echo $vo->name; ?></span></a>
                                        <?php endforeach; endif;
                                    else: echo "";endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="w-sort-bar">
                <div class="bar-area"
                     style="position: relative; left: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; top: 0px;">
                        <span class="sort-area">
                            <a class="sort-default <?php if ($orderflag == ''): ?>sort-default-active<?php endif; ?>">默认</a>
                            <a href="<?php echo url('lists/index', ['id' => $id, 'order_sales' => 1]); ?>"
                               class="sort-item sort-down <?php if ($orderflag == 'order_sales'): ?>sort-default-active<?php endif; ?>"
                               title="点击按销量降序排序">销量↓</a>
                            <a href="<?php echo url('lists/index', ['id' => $id, 'order_price' => 1]); ?>"
                               class="sort-item price-default price <?php if ($orderflag == 'order_price'): ?>sort-default-active<?php endif; ?>"
                               title="点击按价格降序排序">价格↓</a>
                            
                            <a href="<?php echo url('lists/index', ['id' => $id, 'order_time' => 1]); ?>"
                               class="sort-item sort-up <?php if ($orderflag == 'order_time'): ?>sort-default-active<?php endif; ?>"
                               title="发布时间由近到远">最新发布↑</a>
                        </span>

                </div>
            </div>
            <ul class="itemlist eight-row-height">
                <?php if (is_array($res) || $res instanceof \think\Collection || $res instanceof \think\Paginator): $i = 0;
                    $__LIST__ = $res;
                    if (count($__LIST__) == 0) : echo "";
                    else: foreach ($__LIST__ as $key => $vo): $mod = ($i % 2);
                        ++$i; ?>
                        <li class="j-card">
                            <a>
                                <div class="imgbox">
                                    <ul class="marketing-label-container">
                                        <li class="marketing-label marketing-free-appoint"></li>
                                    </ul>
                                    <div class="range-area">
                                        <div class="range-bg"></div>
                                        <div class="range-inner">
                                            <span class="white-locate"></span>
                                        </div>
                                    </div>
                                    <div class="borderbox">
                                        <img src="<?php echo $vo->image; ?>"/>
                                    </div>
                                </div>
                            </a>
                            <div class="contentbox">
                                <a href="<?php echo url('detail/index', ['id' => $vo->id]); ?>" target="_blank">
                                    <div class="header">
                                        <h4 class="title "><?php echo $vo->name; ?></h4>
                                        <div class="collected">精选</div>
                                    </div>
                                    <p><?php echo countLocation($vo->location_ids); ?></p>
                                </a>
                                <div class="add-info"></div>
                                <div class="pinfo">
                                    <span class="price"><span class="moneyico">¥</span><?php echo $vo->current_price; ?></span>
                                    <span class="ori-price">价值<span
                                                class="price-line">¥<span><?php echo $vo->origin_price; ?></span></span></span>
                                </div>
                                <div class="footer">
                                    <span class="comment">4.6分</span><span
                                            class="sold">已售<?php echo $vo->buy_count; ?></span>
                                    <div class="bottom-border"></div>
                                </div>
                            </div>
                        </li>
                    <?php endforeach; endif;
                else: echo "";endif; ?>
            </ul>
        </div>
    </div>
    <div class="content-wrap"><?php echo pagination($res); ?></div>
</div>

<div class="footer-content">
    <div class="copyright-info">

    </div>
</div>
<script>
    var SCOPE = {
        'se_category': "<?php echo url('admin/category/getCategorySon'); ?>"
    }
</script>
<script>
    $(".tab-item-wrap").click(function () {
        var index = $(".tab-item-wrap").index(this);
        $(".tab-item-wrap").removeClass("selected");
        $(".district-cont-wrap").css({display: "none"});
        $(this).addClass("selected");
        $(".district-cont-wrap").eq(index).css({display: "block"});
    });

    $(".sort-area a").click(function () {
        $(".sort-area a").removeClass("sort-default-active").css({color: "#666"});
        $(this).addClass("sort-default-active").css({color: "#ff4883"});
    });
</script>
</body>
</html>